package conMgr.model;

public enum UserType
{
	/**
	 * Author write paper and submit for conference.
	 */
	AUTHOR("Author"),
	/**
	 * Reviewer write the review of paper.
	 */
    REVIEWER("Reviewer"),
	/**
	 * Subprogram Chair check the author's paper and at least 3 review
	 * and write recommendation form; submit to Program Chair.
	 */
	SUBPROGRAM_CHAIR("Subprogram Chair"),
	/**
	 * Program Chair review the subprogram chair's recommendation, review and paper
	 * then make decision to publishing or not.
	 */
	PROGRAM_CHAIR("Program Chair"),
	/**
	 * Administrator who can make conference.
	 */
	ADMIN("Administrator");
	
	/**
	 * The friendly name of this user type, suitable for display.
	 */
	private final String friendlyName;
	
	/**
	 * Initializes a new user type.
	 * @param friendlyName The friendly name of this user type, suitable for
	 * display.
	 */
	private UserType(final String friendlyName)
	{
		this.friendlyName = friendlyName;
	}
	
	/**
	 * Gets a flag indicating if this user type is allowed to see the subprogram
	 * chair assigned to a paper. 
	 * @return True if the user type is allowed to the the subprogram chair;
	 * otherwise, false.
	 */
	public boolean canSeePaperSubprogramChair()
	{
		return
			this == SUBPROGRAM_CHAIR ||
			this == PROGRAM_CHAIR ||
			this == ADMIN;
	}
	
	/**
	 * Gets a string representation of this user type suitable for display.
	 */
	public String getFriendlyName()
	{
		return friendlyName;
	};
}
